<?php defined('SYSPATH') or die('No direct script access.');

/**
 * Base Helper class
 * @author cks
 */
class Lib_Message
{
	/**
	  * 生成消息内容
	  * @param  $string
	  * @return string
	  */
	public static function getContent($message)
	{

    if(empty($message)){

      return "";

    }

    $result="";

    $user=$message['fullname'];

    $total=$message['total'];

    switch ($message['type']) {

      case 'praiseup':

        if($total>1){

          $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>和另外".($total-1)."个人赞了您的分享.</span>";

        }

        else{

          $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>"."赞了您的分享.</span>";

        }

        break;

      case 'praisedown':

        if($total>1){

          $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>和另外".($total-1)."个人踩了您的分享.</span>";

        }

        else{

          $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>"."踩了您的分享.</span>";

        }
        
        break;

      case 'wish':

        if($total>1){

          $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>和另外".($total-1)."个人收藏了您的分享.</span>";

        }

        else{

          $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>"."收藏了您的分享.</span>";

        }

        break;

      case 'review':

        if($total>1){

          $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>和另外".($total-1)."个人评论了您的分享.</span>";

        }

        else{

          $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>"."评论了您的分享.</span>";

        }

        break;

      case 'message':

        $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>给您发来私信.</span>";

        break;

      case 'friend':

        $result="<span class='user'><a href='/u/".$user."'>".$user."</a></span><span class='text'>给您发来私信.</span>";

        break;

      default:

        break;
    }

    return $result;
    
	}
}
